<template>
  <div class="app-container" v-loading="pageLoading">
    <researchs @createItem="createItem" @research="research">
      <template v-slot:moreSearch>
        <div class="filter-container">
          <el-input style="width: 260px;" placeholder="输入备件/编码按回车" clearable class="filter-item"
            @keyup.enter.native="research" @clear="research" v-model="query.v">
          </el-input>
        </div>

      </template>

    </researchs>
    <!-- <el-button type="primary" class="fr" @click="createItem">创建</el-button>
    <div class="filter-container">
      <el-input style="width: 260px;" placeholder="输入备件/编码按回车" clearable class="filter-item"
        @keyup.enter.native="research" @clear="research" v-model="query.queryString">
      </el-input>
      <el-button class="filter-item" type="success" plain @click="research">查询</el-button>
    </div> -->
    <z-table :list="list" :tableProps="tableProps" :columns="columns" @editItem="editItem" @deleteItem="deleteItem">

      <template v-slot:operation>
        <a href="javascript:;" class="text-blue">编辑</a>
        <a style="margin-left:5px;" href="javascript:;" class="text-red">删除</a>
      </template>
    </z-table>
    <z-pagination :pagination="pagination" :total="total" :page.sync="query.page" :limit.sync="query.size"
      @change="getList"></z-pagination>
    <z-form-dialog :name="name" :data="data" :formProps="formProps" :fields="fields" @submit="submit"
      :submitLoading="submitLoading" :visible.sync="editFormVisible"></z-form-dialog>

  </div>
</template>

<script>
import researchs from '@/views/tpm/components/research.vue'
import commonMixin from '@/views/_common/mixin'
export default {
  name: 'attachmentScrap',
  mixins: [commonMixin],
  components: { researchs },
  props: {},
  data() {
    return {
      query: {
        queryString: '',
        page: 1,
        size: 10,
      },
      name: '报废申请',
      tableProps: {
        border: true,
        opsColWith: 80,
        fixed: false,
        highlightCurrentRow: true,
        hideOperations: false,
      },
      columns: [
        { title: '备件编号', key: 'key_part_no', width: 100, fixed: 'left' },
        { title: '备件料号', key: 'key_part_name', width: 100, fixed: 'left' },
        { title: '备件型号规格', key: 'category', width: 140 },
        { title: '数量', key: 'key_part_type', width: 80 },
        { title: '原因', key: 'model_name', width: 80 },
        { title: '审核人', key: 'brief_code', width: 100 },
        { title: '审核结果', key: 'key_part_desc', width: 100, fixed: 'right' },
        { title: '审核日期', key: 'unit_code' },
        { title: '备注', key: 'modify_time' },
      ],
      list: [
        {
          brief_code: null,
          category: 2,
          create_time: '2022-03-30 09:56:56',
          create_user: 'administrator',
          e_code: null,
          erp_create_date: '1900-01-01 00:00:00',
          erp_modify_date: '1900-01-01 00:00:00',
          id: 'b9ddd873-5905-4df6-85f8-5a52cbdf0e40',
          is_valid: 'Y',
          key_part_desc: '燃料电池母电堆',
          key_part_name: '燃料电池母电堆',
          key_part_no: 'P010',
          key_part_type: '',
          model_code: '05',
          model_id: '52cc7343-567b-4025-ac9d-84e54504a073',
          model_name: '零星采购',
          modify_time: '2022-04-15 11:35:56',
          modify_user: 'administrator',
        },
        {
          brief_code: null,
          category: 2,
          create_time: '2022-03-30 09:56:56',
          create_user: 'administrator',
          e_code: null,
          erp_create_date: '1900-01-01 00:00:00',
          erp_modify_date: '1900-01-01 00:00:00',
          id: 'b9ddd873-5905-4df6-85f8-5a52cbdf0e40',
          is_valid: 'Y',
          key_part_desc: '燃料电池母电堆',
          key_part_name: '燃料电池母电堆',
          key_part_no: 'P010',
          key_part_type: '',
          model_code: '05',
          model_id: '52cc7343-567b-4025-ac9d-84e54504a073',
          model_name: '零星采购',
          modify_time: '2022-04-15 11:35:56',
          modify_user: 'administrator',
        },
        {
          brief_code: null,
          category: 2,
          create_time: '2022-03-30 09:56:56',
          create_user: 'administrator',
          e_code: null,
          erp_create_date: '1900-01-01 00:00:00',
          erp_modify_date: '1900-01-01 00:00:00',
          id: 'b9ddd873-5905-4df6-85f8-5a52cbdf0e40',
          is_valid: 'Y',
          key_part_desc: '燃料电池母电堆',
          key_part_name: '燃料电池母电堆',
          key_part_no: 'P010',
          key_part_type: '',
          model_code: '05',
          model_id: '52cc7343-567b-4025-ac9d-84e54504a073',
          model_name: '零星采购',
          modify_time: '2022-04-15 11:35:56',
          modify_user: 'administrator',
        },
        {
          brief_code: null,
          category: 2,
          create_time: '2022-03-30 09:56:56',
          create_user: 'administrator',
          e_code: null,
          erp_create_date: '1900-01-01 00:00:00',
          erp_modify_date: '1900-01-01 00:00:00',
          id: 'b9ddd873-5905-4df6-85f8-5a52cbdf0e40',
          is_valid: 'Y',
          key_part_desc: '燃料电池母电堆',
          key_part_name: '燃料电池母电堆',
          key_part_no: 'P010',
          key_part_type: '',
          model_code: '05',
          model_id: '52cc7343-567b-4025-ac9d-84e54504a073',
          model_name: '零星采购',
          modify_time: '2022-04-15 11:35:56',
          modify_user: 'administrator',
        },
        {
          brief_code: null,
          category: 2,
          create_time: '2022-03-30 09:56:56',
          create_user: 'administrator',
          e_code: null,
          erp_create_date: '1900-01-01 00:00:00',
          erp_modify_date: '1900-01-01 00:00:00',
          id: 'b9ddd873-5905-4df6-85f8-5a52cbdf0e40',
          is_valid: 'Y',
          key_part_desc: '燃料电池母电堆',
          key_part_name: '燃料电池母电堆',
          key_part_no: 'P010',
          key_part_type: '',
          model_code: '05',
          model_id: '52cc7343-567b-4025-ac9d-84e54504a073',
          model_name: '零星采购',
          modify_time: '2022-04-15 11:35:56',
          modify_user: 'administrator',
        },
      ],
      fields: [
        { title: '报废申请', key: 'key_part_no', span: 12, name: 'select' },
        { title: '备件编号', key: 'key_part_type', span: 12 },
        { title: '备件料号', key: 'key_part_type', span: 12 },
        {
          title: '备件规格型号',
          key: 'model_id',
          span: 12,
        },
        { title: '数量', key: 'key_part_name', span: 12 },
        { title: '审核人', key: 'key_part_desc', span: 12 },

        { title: '原因', key: 'brief_code', span: 12, name: 'textarea' },
      ],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>

<style lang="less" scoped></style>